Programmable error correction capability for BCH codes

ABSTRACT

An embodiment of the invention relates to a BCH encoder formed with linear feedback shift registers (LFSRs) to form quotients and products of input polynomials with irreducible polynomials of a generator polynomial g(x) of the BCH encoder, with and without pre-multiplication by a factor x m . The BCH encoder includes multiplexers that couple LFSR inputs and outputs to other LFSRs depending on a data input or parity generation state. The BCH encoder can correct up to a selectable maximum number of errors in the input polynomials. The BCH encoder further includes LFSR output polynomial exponentiation processes to produce partial syndromes for the input data in a syndrome generation state. In the syndrome generation state the LFSRs perform polynomial division without pre-multiplication by the factor x m . The exponentiation processes produce partial syndromes from the resulting remainder polynomials of the input data block.

TECHNICAL FIELD

An embodiment of the invention relates generally to encoding anddecoding and methods, and more particularly to providing aBose-Chaudhuri-Hocquenghem (BCH) encoder and decoder with flexible errordetection and correction capability.

BACKGROUND

Flash memory devices such as those used in solid-state disks requireerror correcting codes in order to prevent information loss. Bit errorrates in such memory devices are increasing with each new devicegeneration as semiconductor feature sizes are reduced and the number ofbits per memory cell is increased. The result is a need for differenterror correction capabilities in different flash memory controllers anddifferent amounts of reserved semiconductor area for parity bits insuccessive device generations.

In a flash memory device such as a NAND gate-based memory device, datais generally stored in blocks of, e.g., 512 bytes, i.e., in blocks of4096 bits. Parity bits are added to each block of data so that a numberof bit errors can be detected and corrected. For a block of 512 bytes,78 parity bits can be added to the 512 bytes to provide error detectionand correction capability for up to six bits.

Hardware solutions with programmable error correction capability usingReed-Solomon codes have been used for various error detection andcorrection applications, e.g., magnetic memory devices such as hard diskdrives which generally produce bursts of errors. However, these are notwell suited for flash memory devices which suffer from isolated randomerrors. A BCH code is the preferred protection technique for the randomerrors encountered in flash memory devices.

A substantial amount of logic and associated semiconductor area must beincluded in a flash memory controller to provide a high level ofencoding and decoding capability such as to correct six bits or more ina block of 512 bytes. It is now common practice to provide a specificdesign for a flash memory controller to detect and correct a particularnumber of error bits.

A BCH encoder and decoder employing conventional design practices wouldswitch between different BCH encoder implementations to providedifferent levels of error detection and correction capability, wastingsemiconductor area and limiting programmability to the particular BCHencoders included in the design. In order to provide a common controllerthat can be used for different flash memory devices, a BCH encoder withprogrammable error correction capability would provide an advantageoussolution, substantially reducing the semiconductor area required for thelong BCH block codes used in flash memory devices.

SUMMARY OF THE INVENTION

In accordance with an exemplary embodiment, a BCH encoder and a relatedmethod are provided. In an embodiment, a BCH encoder includes t_(max)linear feedback shift registers (“LFSRs”). In a data input state, eachLFSR forms a remainder of a respective input stream of bits representedas an input polynomial in a variable x with a respective polynomialm_(i) in the variable x, with pre-multiplication of the respective m_(i)polynomial by the factor x^(m), each of the t_(max) polynomials having adegree m. The data input state is maintained while the input data blockis clocked into the BCH encoder. The m_(i) polynomials (i=1 . . .2t_(max-1)) are irreducible polynomials of a generator polynomial of theBCH encoder. In a parity generation state, each LFSR is configured toform a product of the respective remainder polynomial with therespective m_(i) polynomial. The parity generation state is maintainedwhile the parity bit sequence is clocked out of the BCH encoder. The BCHencoder further includes t_(max) multiplexers, wherein an output of eachmultiplexer is coupled to a respective LFSR input. In the data inputstate, a first input of the first multiplexer is coupled to an inputdata block to the BCH encoder, and a first input of each successivemultiplexer is coupled to an output of the preceding LFSR. In the paritygeneration state, a second input of the last multiplexer is set to zeroand a second input of each preceding multiplexer is coupled to an outputof a succeeding LFSR. The remainder represents a parity bit sequence forthe input data block to the BCH encoder.

In an embodiment, the BCH encoder is configured to correct up to aselectable maximum of errors in the input data block, the selectablemaximum not exceeding t_(max).

In an embodiment, the BCH encoder further includes an excess number ofLFSRs that are selectively disabled by an input signal. In anembodiment, the excess number of LFSRs includes LFSRs beyond the numberof LFSRs necessary to perform an encoding process to correct up to theselectable maximum number of errors in the input data block.

In an embodiment, the BCH encoder further includes a polynomialexponentiation process coupled to an LFSR output, wherein the BCHencoder in a syndrome generation state performs polynomial divisionwithout pre-multiplication by the factor x^(m), and wherein theexponentiation process in the syndrome generation state produces apartial syndrome from the resulting remainder polynomial of the inputdata block. In an embodiment, the polynomial exponentiation processraises the respective LFSR polynomial output to a power related to anumber of the respective LFSR in the syndrome generation state. Thesyndrome generation state is maintained during a decoding process.

BRIEF DESCRIPTION OF THE DRAWINGS

The details of one or more embodiments of the invention are set forth inthe accompanying drawings and the description below. Other features,objects, and advantages of the invention will be apparent from thedescription and drawings, and from the claims. In the figures, identicalreference symbols generally designate the same component partsthroughout the various views, and may be described only once in theinterest of brevity. For a more complete understanding of the invention,reference is now made to the following descriptions taken in conjunctionwith the accompanying drawings, in which:

FIG. 1 illustrates a block diagram of a conventional LFSR that can beused to implement a BCH encoding function;

FIG. 2 illustrates a block diagram showing the structure of aconventional BCH decoder;

FIG. 3 illustrates a block diagram illustrating the mathematicalprinciples to make a BCH encoder programmable to correct a number of biterrors, constructed according to an exemplary embodiment;

FIG. 4 illustrates a block diagram of a conventional LFSR thatimplements binary divider circuitry with pre-multiplication by thefactor x^(m);

FIG. 5 illustrates a block diagram of a conventional LFSR configured toperform binary multiplication by a polynomial;

FIG. 6 illustrates a block diagram of an LFSR implementing a combinedbinary polynomial divider with x^(m) pre-multiplication and a polynomialmultiplier, constructed according to an embodiment;

FIG. 7 illustrates a block diagram of a programmable BCH encoder for arange of correctable errors up to a maximum number, constructedaccording to an embodiment;

FIG. 8 illustrates a block diagram of a conventional binary divider LFSRwithout x^(m) pre-multiplication;

FIG. 9 illustrates a block diagram of a combined LFSR circuit for BCHencoding and syndrome generation that advantageously can be used as abuilding block for a BCH encoder/syndrome generator with a programmablelevel of error correction capability, constructed according to anembodiment; and

FIG. 10 illustrates a block diagram of a combined BCH encoder/syndromedecoder with a programmable level of error correction capability,constructed according to an embodiment.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The making and using of the presently preferred embodiments arediscussed in detail below. It should be appreciated, however, that thepresent invention provides many applicable inventive concepts that canbe embodied in a wide variety of specific contexts. The specificembodiments discussed are merely illustrative of specific ways to makeand use the invention, and do not limit the scope of the invention.

The present invention will be described with respect to exemplaryembodiments in a specific context, namely coding and decoding processesfor BCH codes with flexible error correction capability.

An embodiment of the invention may be applied to various encoding anddecoding arrangements, for example, to encoding and decodingarrangements in memory devices such as flash and hard disk memorydevices. Other encoding and decoding arrangements can be constructed andapplied using processes as introduced herein in different contexts usinginventive concepts described herein, for example, an encoding anddecoding arrangement used to communicate over a noisy communicationchannel.

An encoder appends parity bits to a data message to provide errordetection and correction capability for random bit errors that may begenerated during a storage process associated with a memory device orduring a transmission process associated with a communication channel. Acontroller for a device such as a flash memory device is often aseparate chip from the flash memory chip itself and includes a processto append parity bits to a block of data transferred to the memorydevice for storage therein. The controller thus includes an encodingprocess to append the parity bits to a block of data prior to storage,and a decoding process to examine the stored data and the parity bitsand correct up to a number of errors in the stored data before the datais transferred to a host computer.

The use of clocked registers and modulo-2 arithmetic to implementencoders and decoders for block codes based on generator polynomials iswell known in the art. For example, C. E. Cox, et al., in U.S. Pat. No.5,444,719, C. P. Zook, et al., in U.S. Pat. No. 5,822,337, C. E. Cox, etal., in U.S. Pat. No. 6,405,339, and O. Falik, et al., in U.S. patentapplication 2007/0157064 describe the use of sequential linear processesto perform coding and decoding for block codes. These patents and thepatent application are hereby referenced and incorporated herein.

BCH codes are generally preferred for flash memory devices, based on theisolated random nature of errors in these storage devices. Theproperties of a BCH code word can be described as follows: A BCH codeword is of length n=2^(m-1), for a parameter m. To provide errorcorrection capability of “t” bits, the minimum Hamming distance betweencode words must be at least d_(min)≧2·t+1. For k message bits, thenumber of check bits (“parity bits”) is n−k≦m·t, where equality normallyholds. The parameter m is selected to provide the required errorcorrection capability t in view of the number of message bits k and thenumber of check bits.

As an example, for k=4096 message bits (corresponding to 512 bytes ofdata, the typical sector size in a magnetic memory-based computerstorage system) and up to t=6 error bits that can be corrected, theparameter m is selected to be 13, and the code word is of lengthn=m·t+k=4174 bits. This is generally abbreviated as a shortened “(4174,4096, 6)” BCH code.

The process of correcting a code word containing one or more bit errorsis to identify a closest legal code word. The minimum separation Hammingdistance of d_(min)≧2·t+1 provides the geometric property for selectinga closest legal code word with up to t errors. A smaller d_(min) wouldrender the choice of a closest legal codeword ambiguous.

A generator polynomial g(x) of a BCH code is the LCM (Least CommonMultiple) of the set of irreducible polynomials {m₁(x), m₃(x), . . . ,m_(2t-1)(x)}, with m₁(x), . . . , m_(2t-1)(x), being polynomials ofdegree m. Every irreducible polynomial of degree m divides x² ^(m) ⁻¹+1.Instead of using a direct implementation of the generator polynomialwith fixed t-bits of error correction capability in a single LFSRcircuit, t_(max) interconnected LFSRs are introduced to implementindividual divider/multiplier circuits for the individual irreduciblepolynomials m₁(x), m₃(x), . . . , m_(2tmax-1)(x). Such a configurationas introduced herein allows fully programmable error correctioncapability without unnecessary area overhead or with limitedprogrammability compared to conventional LFSR implementations.

Turning now to FIG. 1, illustrated is a conventional LFSR that can beused to implement a BCH encoding function to produce a fixed number ofparity bits n−k=m·t. The LFSR includes n−k one-bit registers R, coupledto coefficients g₀, . . . g_(n-k-1) and to n−k modulo-2 summers such asmodulo-2 summer 101. The feedback coefficients g₀, . . . g_(n-k-1) areset to the coefficients of the generator polynomialg(x)=g_(n-k-1)·x^(n-k-1)+g_(n-k-2)·x^(n-k-2)+ . . . +g₀ for the requiredBCH code to produce parity bits in the registers R. All the registers Rare initially cleared to “0” to create an initial operating point. Aninput bit stream of data of length k is then clocked into the encoder oninput line 102 to produce the required n−k parity bits in the n−kregisters R. The n−k parity bits are appended at the end of the kmessage bits, and the total n bits are then stored in the flash memorydevice. Accordingly, a flash memory device is constructed with “spare”semiconductor memory area to accommodate the appended parity bits. Allof the arithmetic operations illustrated in FIG. 1 (and in the followingfigures) are performed with modulo-2 “exclusive-or” arithmetic, i.e.,arithmetic defined over a Galois field GF(2).

The conventional LFSR illustrated in FIG. 1 is constructed with a fixednumber of registers and is not programmable with respect to a maximumerror correction capability. It is recognized that flash memory devicesare rapidly increasing in memory density from generation to generation,and include larger spare areas for parity bits to accommodate theincreasing levels of data errors associated with the higher memorydensities. Thus, it is desirable to design a flash memory controller forencoding and decoding BCH codes that can flexibly accommodate theincreasing levels of bit error detection and correction. For example,for one product it may be necessary to correct up to six bit errors in a512 byte block, and for another, up to eight bit errors.

Turning now to FIG. 2, illustrated is a block diagram showing thestructure of a conventional BCH decoder. When data is read back from aflash memory device, several steps are performed in the BCH decoder todetect and correct the bit errors. The first decoding step is syndromegeneration for the block of data of length n read back from the flashmemory device including the n−k parity bits. The syndromes are asequence of binary words related to bit errors in the data read backfrom the flash memory device. The syndromes define a set of equationsthat are solved in the “key equation solver” described below. Allsyndromes of zero are indicative of no errors. Syndrome generation isimplemented with constant, finite-field multipliers and finite fieldadders. The number of (used) syndromes can be made programmable in anembodiment up to a maximum designed error correction capability.

The second decoding step is execution of the key equation solver tocalculate a bit error location polynomial. A common implementation usesan iterative Massey-Berlekamp algorithm that is known in the art. Thisproduces a polynomial that is the input to the Chien search described inthe next step.

The third decoding step is execution of a “Chien search” on the biterror location polynomial. The Chien search is named after R. T. Chienfor his paper entitled “Cyclic Decoding Procedure for theBose-Chaudhuri-Hocquenghem Codes,” IEEE Transactions on InformationTheory, Vol. IT-10, pp. 357-363, October 1964, which is herebyreferenced and incorporated herein. The Chien search is an iterativealgorithm known in the art for determining roots of polynomials definedover a Galois field. The error location polynomial is evaluated forevery bit position of the code word. If the error location polynomialhas a root at an evaluated bit position, an error location has beenfound. Each root represents a one-bit error in the k message bits or then−k parity bits. If more than t roots are found for a particular blockof n data bits, then an error condition has occurred wherein more errorsare detected then can be reliably corrected because the Hammingcondition on code word separation distance d_(min)≧2·t+1 has not beensatisfied.

The next decoding step is error correction. This process corrects thememory errors that were identified by the Chien search. For binary BCHcodes, the bit at the found error location is inverted in a FIFO (firstin, first out) memory. The FIFO memory is a convenient vehicle to holdthe received data until all errors have been corrected.

A controller manages the operation of these several steps.

Referring back to FIG. 1, it is necessary to set the coefficients of thegenerator polynomial g(x)=g_(n-k-1)·x^(n-k-1)+g_(n-k-2)·x^(n-k-2)+ . . .+g₀ for the required BCH code for the encoder for the number of errors tthat are desired to be corrected. For example, to correct six errors forthe parameter m equal to 13, then 13·6=78 parity bits are required, asare 78 one-bit registers for the LFSR. The polynomials m_(i)(x) and thecorresponding generator polynomial g(x) are tabulated for BCH coding forvarious numbers t of correctable errors in various papers and textbooks,and will not be repeated here in the interest of brevity. The polynomialg(x) is produced by forming the product of the polynomials m_(i)(x). Asdescribed later hereinbelow, the error correction capability t of anencoder can be made programmable as introduced herein by usingindividual divider circuits for the polynomials that are reconfigured asmultipliers during shift-out of the parity check bits.

Turning now to FIG. 3, illustrated is a block diagram illustrating themathematical principles to make a BCH encoder programmable to correct tbit errors employing an embodiment. This same hardware can be used forBCH encoding and decoding processes, as well as encoding and decodingprocesses with a selectable number of correctable errors. Instead ofimplementing the generator polynomial g(x) by an LFSR, the polynomiald(x) representing the input data is divided by t_(max) individualm_(i)(x) polynomials each of respective degree m and simultaneouslymultiplied by the factor x^(m), followed by t_(max) multiplications ofthe same m_(i)(x) polynomials. Error correction capability now can beeasily controlled by additional pairs of corresponding polynomialdivider and multiplier stages.

The input polynomial illustrated on the left side of FIG. 3 is themessage data polynomial d(x) of degree k−1, e.g., 4096 bitscorresponding to a codeword polynomial c(x) of degree n−1. A polynomialhas a one-to-one relationship with a sequence of data bits. For example,the data sequence “1001” corresponds to the polynomial1·x^(k-1)+0·x^(k-2)+0·x^(k-3)+1·x^(k-4) for the variable x that canassume binary values 0 and 1. At the beginning of a block of data, theregisters in each of the dividers and multipliers are initialized tozero. The message data polynomial d(x) is then fed as input to asequence of divider blocks for the polynomials m_(i)(x) of respectivedegree m with pre-multiplication by the factor x^(m). For every errorthat is desired to be corrected, such as six errors, apre-multiplier/divider process is required. The result of these stepsproduces the polynomial q(x)=[x^(m)/m₁(x)]·[x^(m)/m₃(x)]· . . .·[x^(m)/m_(2tmax-1)(x)]. The result of these pre-multiplier dividerprocesses is then fed forward to a series of t_(max) correspondingmultipliers, m_(2tmax-1)(x), . . . , m₃(x), m₁(x), organized in amirrored sequence to that of the divider processes. The result producesthe polynomial c(x)=g(x)·q(x)+r(x), where r(x)=x^(n-k)·d(x) mod g(x).The polynomial r(x) is the remainder polynomial of degree n−k(representing parity check bits). Each divider and multiplier registerin this sequence comprises m (e.g., 13) bits. The parity phase is setequal to “1” at the AND gate 301 to shift out the first k cycles at theoutput: c(x)=g(x)·q(x). The parity phase is set equal to “0” at the ANDgate 301 to shift out the remaining n−k cycles at the output, i.e., theremainder polynomial r(x). When the parity phase is set equal to “0”,only 0s are shifted into the multiplier stages.

What has not been obvious is that the registers in a divider block andin a corresponding multiplier block in FIG. 3 have the same contents atany clock cycle. For example, in FIG. 3 the m-bit (e.g., 13-bit)contents of block 302 at any clock cycle are the same as the m-bitcontents of block 303, suggesting that there is redundant hardwarepresent in the process. This observation is used to employ a minimumnumber of registers to implement a BCH encoder.

Turning now to FIG. 4, illustrated is a conventional LFSR thatimplements binary polynomial divider circuitry with pre-multiplicationby x^(m). The LFSR includes m one-bit registers R, coupled tocoefficients g₁, . . . g_(m-1) and m modulo-2 adders such as adder 401.The feedback coefficients g₁, . . . g_(m-1) are set as necessary toperform a particular polynomial divider function. All the registers Rare initially cleared to “0” to create an initial operating point. Aninput bit stream of data is clocked into the encoder on input line 402to produce the required sequence of bits at the output 403. The binarydivider/pre-multiplier illustrated in FIG. 4 provides the correspondingcapability to that illustrated in the left portion of FIG. 3 before theAND gate 301.

Turning now to FIG. 5, illustrated is a conventional LFSR configured toperform binary multiplication by a polynomial represented by thecoefficients g_(i). This LFSR exhibits substantially the same logicalstructure as that illustrated in FIG. 4 with the exception of reversalof the input and output nodes. The rightmost register of the multiplierLFSR corresponds with the rightmost register of the divider LFSR. Inaddition, the coefficients g_(i) also exhibit a direct correspondencebetween the two LFSRs, suggesting that the circuit illustrated in FIG. 4can be combined with the circuit illustrated in FIG. 5 with only modestmodifications.

Turning now to FIG. 6, illustrated is an embodiment of an LFSRimplementing a combined binary polynomial divider (with x^(m)pre-multiplication) and a polynomial multiplier, combining thefunctionality of the circuits illustrated in FIGS. 4 and 5. The combinedcircuit relies on the observation noted above that the registers ofcorresponding divider and multiplier circuits have the same content ateach clock cycle, allowing them to be combined into a single LFSR sothat the overall number of registers is the same as for a conventionalBCH encoder. The circuit includes an additional one-bit control signal“mult” to the multiplexer 601 that accommodates switching between themultiplication mode and the division mode of operation. The controlsignal mult selects the operational input to the multiplexer 601 that isforwarded to its output. If mult=1, the circuit is operational as apolynomial multiplier. If mult=0, the circuit is operational as apolynomial divider (with x^(m) pre-multiplication). The signal “reset”is a reset signal that resets the contents of the registers R to zero toinitialize the process.

Turning now to FIG. 7, illustrated is a block diagram of an embodimentof a programmable BCH encoder for a range of correctable errors up to amaximum number t_(max). Relying on certain mathematical characteristicsof BCH codes, the error correction capability of the BCH encoder isadvantageously made programmable by using individual divider circuitsfor the polynomials m₁(x) . . . m_(2tmax-1)(x), that are re-configuredas multipliers during shift-out of parity check bits. The blocks“mult/div LFSR_(i)”, i=1, 3, . . . , 2t_(max)−1, such as block 701, eachrepresent the combined binary divider (with x^(m)pre-multiplication)/multiplier circuit illustrated in FIG. 6.

There are t_(max) instances of the combined divider/multiplier circuitsto selectively support up to t_(max) correctable errors. In a particularapplication, for example in a particular flash memory device, themaximum number of errors that can be corrected is related to the amountof spare area provided for the parity bits.

Multiplexers, such as multiplexer 702, selectively transfer an inputsignal to the output thereof dependent on the value of the binarycontrol signal “s” that is coupled to the input control signal“parity_out.” The signal parity_out corresponds with the signal “mult”illustrated in FIG. 6. The signals “t₂,” etc., are coupled to the“reset” input illustrated in FIG. 6.

The maximum programmable error correction capability t_(max) provided bythe circuit illustrated in FIG. 7 is limited by the number ofdivider/multiplier circuits that are actually implemented. The errorcorrection capability, and thus the number of parity check bits, isprogrammable by control of the signals t₁, t₂, etc., that keep alldivider/multiplier LFSRs in a reset state when they are not needed. Forexample, if it is desired to correct only one error, then the signal t₁would be set to 1, and the remaining signals to the right would be setto 0. For this example, where only one bit of error correction isrequired, then all LFSRs to the right of the first LFSR are kept in areset state by the signals t₂, . . . , t_(max).

In operation, the parity out control signal is maintained de-asserted(i.e., set to 0) for k clock cycles while the k data bits are shiftedinto the circuit on the input line “data.” During this data entry phaseafter the registers have been initially reset to zero, the input dataflows from the left to the right through the divider/multiplier LFSRblocks. The LFSRs are configured as dividers with x^(m)pre-multiplication. After the last data bit has been processed, theparity out signal is asserted (i.e., set to 1) for n−k=m·t clock cycles,and the (n−k=m·t) parity bits are shifted out. During this paritygeneration phase, the data flows from the right to the left through thedivider/multiplier LFSR blocks. In this phase, the LFSRs are configuredas a chain of multipliers, which provide the parity polynomialcoefficients of r(x) at the output. Multiplexer 703 selectively combinesthe data and the parity bits based on the input signal parity out toprovide a clocked sequence of output data on line 704.

A further embodiment combining a BCH encoder and a BCH syndromegenerator is now introduced. Again, the error correction capability isfully programmable.

A binary divider LFSR with pre-multiplication by x^(m) was previouslydescribed hereinabove with reference to FIG. 4.

Turning now to FIG. 8, illustrated is a block diagram of a conventionalbinary divider LFSR without pre-multiplication by x^(m). On comparingthe binary divider with pre-multiplication illustrated in FIG. 4 withthe binary divider without pre-multiplication illustrated in FIG. 8, itis apparent that both circuits can be combined with the inclusion of onemultiplexer.

Turning now to FIG. 9, illustrated is a block diagram of a combined LFSRcircuit for BCH encoding and syndrome generation in an embodiment thatadvantageously can be used as a building block for a BCHencoder/syndrome generator with programmable error correctioncapability. The LFSR circuit includes registers R and binarycoefficients g₁, g₂, . . . , g_(m-1) that are coefficients of therelated irreducible polynomial factors m_(i)(x). The LFSR circuitfurther includes multiplexers 901 and 902 responsive to control signals“pre_mult” and “mult” that enable or disable polynomial division andenable or disable pre-multiplication by the factor x^(m). If mult=1 thenpolynomial multiplication is enabled. If mult=0 then polynomial divisionwith or without pre-multiplication is enabled. If pre_mult=1, thenpre-multiplication by the factors x^(m) is enabled.

Circuitry for syndrome generation can be reused as a programmableBCH-encoder if divider circuits (LFSRs) are used for syndromegeneration. Turning now to FIG. 10, illustrated is a block diagram of anembodiment of a combined BCH encoder/syndrome decoder with programmableerror correction capability. The blocks 1002 represent exponentiation ofan input polynomial to the indicated power, which can be performed usingtechniques well known in the art. Remaining elements in FIG. 10 similarto those in FIG. 7 will not be redescribed in the interest of brevity.The embodiment illustrated in FIG. 10 provides the capability tomultiply or to divide by a polynomial. In the dividing mode it has thecapability to provide or to disable pre-multiplication by the factorsx^(m). Thus, three modes of operation necessary for encoding anddecoding are provided by the circuit illustrated in FIG. 10 using theset of LFSRs.

By asserting the signal “syn_gen,” the circuitry is put into a syndromegeneration mode. The signal syn_gen illustrated in FIG. 10 correspondsto the signal pre_mult (i.e., division without pre-multiplication). Thesignal parity_out corresponds to the signal mult. It is noted that thesignals syn_gen and mult cannot both be asserted (i.e., set equal to 1)at the same time. After processing received code word bits, whichconsist of the message bits represented by the polynomial d(x) followedby the parity check bits represented by the remainder polynomial r(x),the LFSR registers contain the remainder produced by dividing thereceived code word by the individual irreducible polynomials m₁(x),m₃(x), . . . , m_(2tmax-1)(x). Syndrome data is generated by dividinginput and parity data by these polynomials. The partial syndromes S_(i),i=1, 3, . . . 2t_(max)−1, can then be calculated by exponentiation ofthe resulting polynomial remainders to the power i. The even numberedpartial syndromes S_(i), i=2, 4, . . . 2t_(max)−2, can be calculatedfrom the partial syndromes S_(i), i=1, 3, . . . , 2t_(max)−1 usingtechniques well known in the art (i.e., S_(2i)=S_(i) ²). Thus,capability to generate a syndrome can be provided with only modestmodification to the LFSR structure illustrated in FIG. 7.

The combined BCH encoder/syndrome generator allows abundant sharing ofhardware resources, especially the registers R, which has a large impacton overall semiconductor area for long BCH block codes, such as the BCHcodes used to provide error detection and correction capability for NANDflash memories.

From a practical perspective, for a 512 byte/4096 bit block, to increasethe number of correctable errors by one, i.e., to increase t_(max) byone, requires an additional 13 parity bits (recalling that the number ofparity bits n−k is generally equal to m·t, where m=13 in the examplediscussed). To correct six errors requires 6·13=78 parity bits. However,twice as many partial syndromes are required. For example, twelve 13-bitpartial syndromes are required to correct six errors for a 512 byte/4096bit block. As described hereinabove, the number of correctable errorscan be changed on the fly up to a maximum number limited by the numberof registers included in the design. Spare area of a particular flashdevice is always same, thus there is no advantage to adapt a level oferror correction over its lifetime. However, bit error rate increaseswith every flash device generation, and is quite different between anSLC (single level cell) and an MLC (multi level cell) flash device.Thus, an adjustable level of error correction is mandatory for flashcontrollers covering several generations and types of flash devices aswell as attaching a mix of SLC and MLC devices to the same flashcontroller. Such an arrangement as introduced herein also allows anadjustable level of error correction based on continuing operationalexperience with a particular device that allows a greater number oferrors to be corrected with slightly compromised operating speed as adevice ages. A decision to change the number of correctable errors canbe readily made based on statistics accumulated over time of past errorcorrecting experience with the device. The initial number of correctableerrors can be selected after a device is manufactured.

Digital circuits are generally implemented with 8-bit bytes. A practicalcircuit implementation of an LFSR can be structured with inner dataloops that operate one bit at a time, and with an outer loop thatoperates on bytes of data.

A general reference for encoding and decoding techniques related to BCHcodes is the book by W. W. Peterson and E. J. Weldon, entitled“Error-Correcting Codes,” Cambridge, Mass., published by MIT Press,1972.

The concept has thus been introduced of forming a BCH encoder witht_(max) LFSRs, each LFSR configured in a data input state to form aremainder of a respective input stream of bits represented as an inputpolynomial in a variable x with a respective polynomial m_(i) associatedwith an LFSR with pre-multiplication of the respective m_(i) polynomialby the factor x^(m), each of the t_(max) polynomials having a degree m.In a parity generation state, each LFSR is configured to form a productof the respective remainder polynomial with the respective m_(i)polynomial. The BCH encoder further includes t_(max) multiplexers,wherein an output of each multiplexer is coupled to a respective LFSRinput. In the data input state, a first input of the first multiplexeris coupled to an input data block to the BCH encoder, and a first inputof each successive multiplexer is coupled to an output of the precedingLFSR. In the parity generation state, a second input of the lastmultiplexer is set to zero and a second input of each precedingmultiplexer is coupled to an output of a succeeding LFSR. In anembodiment, the remainder represents a parity bit sequence for the inputdata block to the BCH encoder. The parity generation state is maintainedwhile the parity bit sequence is clocked out of the BCH encoder. Thedata input state is maintained while the input data block is clockedinto the BCH encoder.

In an embodiment, the BCH encoder is configured to correct up to aselectable maximum of errors not exceeding t_(max) in the input datablock.

In an embodiment, the BCH encoder further includes an excess number ofLFSRs that are selectively disabled by an input signal. In anembodiment, the excess number of LFSRs comprise LFSRs beyond the numberof LFSRs necessary to perform an encoding process to correct up to theselectable maximum of errors in the input data block. In an embodiment,the t_(i) polynomials are irreducible polynomials of a generatorpolynomial of the BCH encoder.

In an embodiment, the BCH encoder further includes a polynomialexponentiation process coupled to an LFSR output, wherein the BCHencoder in a syndrome generation state performs polynomial divisionwithout pre-multiplication by the factor x^(m), and wherein theexponentiation process in the syndrome generation state produces apartial syndrome from the resulting remainder polynomial of the inputdata block. In an embodiment, the polynomial exponentiation processraises the respective LFSR polynomial output to a power related to anumber of the respective LFSR in the syndrome generation state.

Another exemplary embodiment provides a method of operating a BCHencoder. In an embodiment, the method includes forming t_(max) LFSRs. Ina data input state, the method includes forming in each LFSR a remainderof a respective input stream of bits, represented as an input polynomialin a variable x, with a respective one of m_(i) polynomials of a degreem in the variable x with pre-multiplication of the respective m_(i)polynomial by the factor x^(m). In a parity generation state, the methodincludes forming a product in each LFSR of the respective remainderpolynomial with the respective m_(i) polynomial. The method furtherincludes coupling a respective output of t_(max) multiplexers to arespective input of the t_(max) LFSRs, and coupling a first input of thefirst multiplexer to an input data block to the BCH encoder. In the datainput state, the method includes coupling a first input of eachsuccessive multiplexer to an output of the preceding LFSR. In the paritygeneration state, the method includes setting a second input of the lastmultiplexer to zero and coupling a second input of each proceedingmultiplexer to an output of a succeeding LFSR. In an embodiment, theremainder represents a parity bit sequence for the input data block tothe BCH encoder.

In an embodiment, the method includes maintaining the parity generationstate while clocking the parity bit sequence out of the BCH encoder. Inan embodiment, the method further includes maintaining the data inputstate while clocking the input data block into the BCH encoder.

In an embodiment, the method includes configuring the BCH encoder tocorrect up to a selectable maximum number t≦t_(max) of errors in theinput data block by selectively disabling LFSRs. In an embodiment,t_(max)−t LFSRs are disabled to correct the selected maximum of terrors. In an embodiment, the method includes selectively disabling theLFSRs with an input signal.

In an embodiment, the method includes forming the t_(max) polynomials asirreducible polynomials of a generator polynomial of the BCH encoder.

In an embodiment, the method further includes, in a syndrome generationstate, forming the t_(max) LFSRs to perform polynomial division withoutpre-multiplication by the factor x^(m), and exponentiating a respectiveremainder polynomial of the t_(max) LFSRs to produce a partial syndromefor the input data block. In an embodiment, the method further includesin the syndrome generation state exponentiating the respective LFSRstate to a power related to a number of the respective LFSR to producethe partial syndrome.

Although processes for generating parity bits and decoding syndromes forBCH codes and related methods have been described for application todata storage, it should be understood that other applications of theseprocesses such as for communication of data over a noisy channel arecontemplated within the broad scope of the invention, and need not belimited to data storage applications. The error correction capability ofa communication system for a noisy channel may be adapted to the actualnoise level of the channel employing processes introduced herein.

Although the invention has been shown and described primarily inconnection with specific exemplary embodiments, it should be understoodby those skilled in the art that diverse changes in the configurationand the details thereof can be made without departing from the essenceand scope of the invention as defined by the claims below. The scope ofthe invention is therefore determined by the appended claims, and theintention is for all alterations that lie within the range of themeaning and the range of equivalence of the claims to be encompassed bythe claims.

What is claimed is:
 1. A Bose-Chaudhuri-Hocquenghem (“BCH”) encoder,comprising: t_(max) linear feedback shift registers (“LFSRs”), whereint_(max) is greater or equal to two, each LFSR comprises m registers,each LFSR implements a polynomial having a degree m, in a data inputstate, each LFSR is configured to form a remainder of a respective inputstream of bits represented as an input polynomial in a variable x with arespective LFSR m_(i) polynomial with pre-multiplication of therespective m_(i) polynomial by a factor x^(m), and in a paritygeneration state, each LFSR is configured to form a product of therespective input polynomial with the respective LFSR m_(i) polynomial;and t_(max) multiplexers, wherein an output of each multiplexer iscoupled to a respective LFSR input, in the data input state, a firstinput of a first of the t_(max) multiplexers is coupled to an input datablock to the BCH encoder and a first input of each successivemultiplexer is coupled to an output of a preceding LFSR, in the paritygeneration state, a second input of a last of the t_(max) multiplexersis set to zero and a second input of each preceding multiplexer iscoupled to an output of a succeeding LFSR.
 2. The BCH encoder as claimedin claim 1, wherein the remainder represents a parity bit sequence forthe input data block to the BCH encoder.
 3. The BCH encoder as claimedin claim 2, wherein the parity generation state is maintained while theparity bit sequence is clocked out of the BCH encoder.
 4. The BCHencoder as claimed in claim 1, wherein the data input state ismaintained while the input data block is clocked into the BCH encoder.5. The BCH encoder as claimed in claim 1, wherein the BCH encoder isconfigured to correct up to a selectable maximum of t errors notexceeding t_(max) in the input data block.
 6. The BCH encoder as claimedin claim 5, further including an excess number of LFSRs that areselectively disabled by an input signal.
 7. The BCH encoder as claimedin claim 6, wherein the excess number of LFSRs comprise LFSRs beyond thenumber of LFSRs necessary to perform an encoding process to correct upto the selectable maximum of errors in the input data block.
 8. The BCHencoder as claimed in claim 1, wherein the m_(i) polynomials areirreducible polynomials of a generator polynomial of the BCH encoder. 9.The BCH encoder as claimed in claim 1, further including a polynomialexponentiation process coupled to an LFSR output, wherein the BCHencoder in a syndrome generation state performs polynomial divisionwithout pre-multiplication by the factor x^(m), and wherein theexponentiation process in the syndrome generation state produces apartial syndrome from a resulting remainder polynomial of the input datablock.
 10. The BCH encoder as claimed in claim 9, wherein the polynomialexponentiation process raises a respective LFSR output state to a powerrelated to a number of the respective LFSR in the syndrome generationstate.
 11. A method of operating a BCH encoder, the method comprising:forming in each of t_(max) linear feedback shift registers (“LFSRs”) aremainder polynomial of a respective input stream of bits represented asan input polynomial in a variable x with a respective one of t_(max)polynomials of a degree m in the variable x with pre-multiplication ofthe respective m_(i) polynomial by a factor x^(m) when the BCH encoderis in a data input state, and a product of the respective remainderpolynomial with the respective m_(i) polynomial when the BCH encoder isin a parity generation state, wherein each LFSR comprises m registers,each LFSR implements a polynomial of degree m, and t_(max) is greater orequal to two; coupling a respective output of each of t_(max)multiplexers to a respective input of the t_(max) LFSRs; coupling afirst input of a first of the t_(max) multiplexers to an input datablock to the BCH encoder and a first input of each successivemultiplexer to an output of a preceding LFSR in the data input state;and setting a second input of a last of the t_(max) multiplexers to zeroand coupling a second input of each preceding multiplexer to an outputof a succeeding LFSR in the parity generation state.
 12. The method asclaimed in claim 11, wherein the remainder represents a parity bitsequence for the input data block to the BCH encoder.
 13. The method asclaimed in claim 12, further comprising maintaining the paritygeneration state while clocking the parity bit sequence out of the BCHencoder.
 14. The method as claimed in claim 11, further comprisingmaintaining the data input state while clocking the input data blockinto the BCH encoder.
 15. The method as claimed in claim 11, furthercomprising configuring the BCH encoder to correct up to a selectablemaximum of t_(max) errors in the input data block, where t is less thanor equal to t_(max), by selectively disabling LFSRs.
 16. The method asclaimed in claim 15, wherein t_(max)−t LFSRs are selectively disabled tocorrect the selectable maximum of t_(max) errors.
 17. The method asclaimed in claim 15, further comprising selectively disabling the LFSRswith an input signal.
 18. The method as claimed in claim 11, furthercomprising forming the m_(i) polynomials as irreducible polynomials of agenerator polynomial of the BCH encoder.
 19. The method as claimed inclaim 11, further comprising: forming the t_(max) LFSRs to performpolynomial division without pre-multiplication by the factor x^(m) in asyndrome generation state; and exponentiating a respective remainderpolynomial of the t_(max) LFSRs to produce a partial syndrome for theinput data block in the syndrome generation state.
 20. The method asclaimed in claim 19, further comprising: exponentiating the respectiveLFSR output state to a power related to a number of the respective LFSRto produce the partial syndrome in the syndrome generation state.